#ifndef _INPUT_MANAGER_H
#define _INPUT_MANAGER_H

#include <map>
#include "..\Math\Vector2.h"

class SFMLInputManager;
class InputManager
{
public:
	static InputManager& getSingleton();
	static void clean();

	virtual void capture() = 0;

	virtual const bool isKeyDown(const std::string&) const = 0;
	virtual const bool isKeyPressed(const std::string&) const = 0;
	virtual const bool isKeyReleased(const std::string&) const = 0;

	virtual const bool isMouseButtonDown(const std::string&) const = 0;
	virtual const bool isMouseButtonPressed(const std::string&) const = 0;
	virtual const bool isMouseButtonReleased(const std::string&) const = 0;

	virtual void addKeyFunction(const std::string&, void*) = 0;
	virtual void addMouseFunction(const std::string&, void*) = 0;

	const vn::Vector2& getMousePosition() const { return m_mousePosition; }
	
	friend class SFMLInputManager;

protected:
	InputManager(void){}
	virtual ~InputManager(void){}

	static InputManager* m_instance;

	vn::Vector2 m_mousePosition;

	std::map<std::string, bool> m_keyFunctionStates;
	std::map<std::string, bool> m_keyLastFunctionStates;

	std::map<std::string, bool> m_mouseFunctionStates;
	std::map<std::string, bool> m_mouseLastFunctionStates;
	
};

#endif // _INPUT_MANAGER_H

